package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.CartonConsumeTemporaryMapper;
import com.ruoyi.consume.domain.CartonConsumeTemporary;
import com.ruoyi.consume.service.ICartonConsumeTemporaryService;

/**
 * 查看临时领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class CartonConsumeTemporaryServiceImpl implements ICartonConsumeTemporaryService
{
    @Autowired
    private CartonConsumeTemporaryMapper cartonConsumeTemporaryMapper;

    /**
     * 查询查看临时领用信息
     *
     * @param cartonConsumeTemporaryId 查看临时领用信息ID
     * @return 查看临时领用信息
     */
    @Override
    public CartonConsumeTemporary selectCartonConsumeTemporaryById(Long cartonConsumeTemporaryId)
    {
        return cartonConsumeTemporaryMapper.selectCartonConsumeTemporaryById(cartonConsumeTemporaryId);
    }

    /**
     * 查询查看临时领用信息列表
     *
     * @param cartonConsumeTemporary 查看临时领用信息
     * @return 查看临时领用信息
     */
    @Override
    public List<CartonConsumeTemporary> selectCartonConsumeTemporaryList(CartonConsumeTemporary cartonConsumeTemporary)
    {
        return cartonConsumeTemporaryMapper.selectCartonConsumeTemporaryList(cartonConsumeTemporary);
    }

    /**
     * 新增查看临时领用信息
     *
     * @param cartonConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int insertCartonConsumeTemporary(CartonConsumeTemporary cartonConsumeTemporary)
    {
        cartonConsumeTemporary.setCreateTime(DateUtils.getNowDate());
        return cartonConsumeTemporaryMapper.insertCartonConsumeTemporary(cartonConsumeTemporary);
    }

    /**
     * 修改查看临时领用信息
     *
     * @param cartonConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int updateCartonConsumeTemporary(CartonConsumeTemporary cartonConsumeTemporary)
    {
        cartonConsumeTemporary.setUpdateTime(DateUtils.getNowDate());
        return cartonConsumeTemporaryMapper.updateCartonConsumeTemporary(cartonConsumeTemporary);
    }

    /**
     * 批量删除查看临时领用信息
     *
     * @param cartonConsumeTemporaryIds 需要删除的查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deleteCartonConsumeTemporaryByIds(Long[] cartonConsumeTemporaryIds)
    {
        return cartonConsumeTemporaryMapper.deleteCartonConsumeTemporaryByIds(cartonConsumeTemporaryIds);
    }

    /**
     * 删除查看临时领用信息信息
     *
     * @param cartonConsumeTemporaryId 查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deleteCartonConsumeTemporaryById(Long cartonConsumeTemporaryId)
    {
        return cartonConsumeTemporaryMapper.deleteCartonConsumeTemporaryById(cartonConsumeTemporaryId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<CartonConsumeTemporary> getUserName(){
        return cartonConsumeTemporaryMapper.getUserName();
    }
}
